
(function() {
	var BBLib = G.GClass('APP', 'BBLib');
	BBLib.prototype.__init = function(lib) 
	{
		this.libTree = new G.Utils.TreeNode('__BBLIB_ROOT', null);
		this.load_lib(lib);
	}

	BBLib.prototype.load_lib = function(lib, parent)
	{
		var p = parent || this.libTree;

		var n = new G.Utils.TreeNode(lib.name, lib);
		p.append_child(n);
		for (var i in lib.sublibs) {
			this.load_lib(lib.sublibs[i], n);
		}

		for (var i in lib.symbols) {
			this.load_symbol(lib.symbols[i], n);
		}
	}

	BBLib.prototype.load_symbol = function(sym, p)
	{
		var n = new G.Utils.TreeNode(sym.name, sym);
		p.append_child(n);
	}

	BBLib.prototype.get_tree = function()
	{
		return this.libTree;
	}

 })();
